---
import DefaultContent from "./content/DefaultContent.astro"
import PhotoContent from "./content/PhotoContent.astro" 
---
<th:block th:if="${article!= null}">
    <th:block th:if="${article.articleType==0}">
       <DefaultContent />
    </th:block>
    <th:block th:if="${article.articleType==1}">
      <PhotoContent />
    </th:block>
</th:block>

<th:block th:unless="${article!= null}">
   <article id="article-content"
  class="pb-2  flex gap-2 flex-wrap justify-center rounded-lg border border-gray-200/10"
>
  没有找到任何数据！
</article>
</th:block>

<script>
    const ac=document.getElementById("article-content"),wc=document.getElementById("wordCount"),rwt= document.getElementById("reardWordTime");
  if(ac&&wc&&rwt){ 
    const num = graceUtils.countWords(ac.textContent);
  wc.innerHTML = graceUtils.wordCount(num);
  rwt.innerHTML = graceUtils.estimateReadingTime(num);
  }
 
</script>
